#include "chaobruno.h"

#include <GL/glu.h>
#include "gllib/Objects.h"

void ChaoBruno::draw() {
    desenharChao();
}
void ChaoBruno::desenharChao(){
    glEnable(GL_COLOR_MATERIAL);
    glColorMaterial(GL_FRONT, GL_AMBIENT_AND_DIFFUSE);

    float mat_specular[] = {2.0, 2.0, 2.0, 1.0};
    float shininess = 20;

    glMaterialfv(GL_FRONT, GL_SPECULAR, mat_specular);
    glMaterialf(GL_FRONT, GL_SHININESS, shininess);

    glPushMatrix();
    for(int i=0;i<4;i++){
        switch(i){
        case 0:
            glColor3f(0.65,0.65,0.65);
            glScalef(1,0.2,1);
            break;
        case 1:
            glColor3f(0.83,0.83,0.83);
            glTranslatef(0.5,0,0);
            break;
        case 2:
            glColor3f(0.65,0.65,0.65);
            glTranslatef(0,0,0.5);
            break;
        case 3:
            glColor3f(0.83,0.83,0.83);
            glTranslatef(-0.5,0,0);
            break;
        }
        gllibCube(0.5);
    }
    glPopMatrix();
    glDisable(GL_COLOR_MATERIAL);
}
